using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_hr_sponotherMap : EntityTypeConfiguration<so_hr_sponother>
    {
        public so_hr_sponotherMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.main_number)
                .HasMaxLength(50);

            this.Property(t => t.name)
                .HasMaxLength(50);

            this.Property(t => t.religion)
                .HasMaxLength(50);

            this.Property(t => t.nationality)
                .HasMaxLength(30);

            this.Property(t => t.Gender)
                .HasMaxLength(6);

            this.Property(t => t.Current_sponsor_name)
                .HasMaxLength(50);

            this.Property(t => t.Previous_sponsor_name)
                .HasMaxLength(50);

            this.Property(t => t.residence_number)
                .HasMaxLength(50);

            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("so_hr_sponother");
            this.Property(t => t.main_number).HasColumnName("main_number");
            this.Property(t => t.name).HasColumnName("name");
            this.Property(t => t.impaired).HasColumnName("impaired");
            this.Property(t => t.insured).HasColumnName("insured");
            this.Property(t => t.religion).HasColumnName("religion");
            this.Property(t => t.nationality).HasColumnName("nationality");
            this.Property(t => t.Gender).HasColumnName("Gender");
            this.Property(t => t.Current_sponsor_name).HasColumnName("Current_sponsor_name");
            this.Property(t => t.Previous_sponsor_name).HasColumnName("Previous_sponsor_name");
            this.Property(t => t.SPonsored_by_others).HasColumnName("SPonsored_by_others");
            this.Property(t => t.residence_number).HasColumnName("residence_number");
            this.Property(t => t.residence_expiry_date).HasColumnName("residence_expiry_date");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.citizen).HasColumnName("citizen");
        }
    }
}
